  <html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html {width: 100%;height: 100%; margin:0;font-family:"微软雅黑";}
		#l-map{height:300px;width:100%;}
		#r-result,#r-result table{width:100%;}
	</style>
    <script src="http://api.map.baidu.com/components?ak=QMDvD2Anle2gLOINIBUZ1Lhh&v=1.0"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=QMDvD2Anle2gLOINIBUZ1Lhh"></script>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
	<title>驾车导航的结果面板</title>
</head>
<body>
	<div style="height:91%;"><div id="l-map"></div>
	<div id="r-result"></div></div>
    
    
    
</body>
</html> 

<script type="text/javascript">
	var lbsGeo = document.createElement('lbs-geo');
	lbsGeo.addEventListener("geofail",function(evt){ //注册事件
		alert("fail");
	});
	lbsGeo.addEventListener("geosuccess",function(evt){ //注册
		var addr = evt.detail.coords;
		var x = addr.lng;
		var y = addr.lat;
		//alert(x+','+y);
		var spoint = new BMap.Point(x,y);
		createmap(spoint);
	});
	lbsGeo.setAttribute("enable-modified","true");
	lbsGeo.setAttribute("id","geo");
	document.body.appendChild(lbsGeo);




function createmap(p){
	var map = new BMap.Map("l-map");
	map.centerAndZoom(new BMap.Point(<?php echo $_GET['mapapi'];?>), 12);
	var epoint = new BMap.Point(<?php echo $_GET['mapapi'];?>);
	
	var driving = new BMap.DrivingRoute(map, {renderOptions: {map: map, panel: "r-result", autoViewport: true}});
	driving.search(p, epoint);
}
$(function(){
$("#geo").css({'position':'absolute','top':'0px','left':'0px','width':'100%'});
	
	
	
	});



</script>
